package com.rc.saas.mini.service.hlhtsk;

import com.rc.saas.mini.mapper.hlhtsk.HlhtskBizTenantMapper;
import com.rc.saas.mini.model.hlhtsk.HlhtskBizTenant;
import com.rc.saas.mini.model.hlhtsk.HlhtskBizTenantExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class HlhtskBizTenantServiceimpl implements  HlhtskBizTenantService{
    @Autowired
    private HlhtskBizTenantMapper hlhtskBizTenantMapper;

    @Override
    public HlhtskBizTenant selectByTenantCodeAndOperatorId(String tenantCode, String hlhtOperatorId, String hlhtType) {
        //hlht_type 申请的互联互通类型,以tenant_code为基准，0反向对接 1正向对接, 默认0
        HlhtskBizTenantExample example = new HlhtskBizTenantExample();
        example.createCriteria().andTenantCodeEqualTo(tenantCode).andHlhtOperatorIdEqualTo(hlhtOperatorId)
                .andHlhtTypeEqualTo(hlhtType).andStatusEqualTo("0");
        return hlhtskBizTenantMapper.selectByExample(example).stream().findFirst().orElseGet(() -> null);
    }

    @Override
    public HlhtskBizTenantMapper getMapper() {
        return null;
    }
}
